<?php
include_once("../../../common/module/checkA.php");
include_once("../../../../config.php");
include_once("../controller/detail-statistic.php");
?>


<?
//用来判断当前系统属于什么板块
$system_part = $plate['mid'];
include_once("detail-function.php");
?>


<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <?php include ROOT_PATH_.'/controller/common/module/head.php'; ?>
    <?php include 'modules/head.php'; ?>
    <link href="../asset/css/member.css"      rel="stylesheet" type="text/css"/>
    <script src="/application/keditor/kindeditor-all.js"></script>

</head>

<body>

<div id="topbar"><?php include ROOT_PATH_.'/controller/common/module/topbar.php'; ?></div>

<div id="container" class="<? echo $system_part ?>">

    <div id="maincontent">

        <div id="sidebar">
            <?php include ROOT_PATH_.'/controller/common/module/sidebar.php'; ?>
        </div>


<div id="content" class="layui-form">
<h1>资料信息</h1>

<div class="detail-box member-edit-box layui-form">

<div class="detail-boxes">
<ul class="detail-boxing">





    <div class="data">
        <button type="button" class="layui-btn layui-btn-primary layui-btn-xs">创建邮件</button>
        <button type="button" class="layui-btn layui-btn-primary layui-btn-xs">创建报价</button>
        <button type="button" class="layui-btn layui-btn-primary layui-btn-xs">创建订单</button>
    </div>

    <br/>




    <div class="info">
        <div class="sbox">
            <div class="relation">
                <text class="state"><? echo $detail['name']?></text>
                <text>名称</text>
            </div>
        </div>

        <div class="sbox">
            <div class="relation">
                <text class="state"><? echo $detail['gender']?></text>
                <text>性别</text>
            </div>
        </div>


        <div class="sbox">
            <div class="relation">
                <text class="state"><? echo $detail['position']?></text>
                <text>职务</text>
            </div>
        </div>

        <div class="sbox">
            <div class="relation">
                <text class="state"><? echo $detail['unit']?></text>
                <text>所属</text>
            </div>
        </div>

        <div class="sbox">
            <div class="relation">
                <text class="state"><? echo $detail['phone']?></text>
                <text>电话</text>
            </div>
        </div>


        <div class="sbox">
            <div class="relation">
                <text class="state"><? echo $detail['email']?></text>
                <text>邮箱</text>
            </div>
        </div>

        <div class="sbox">
            <div class="relation">
                <text class="state">查询跟进的企业</text>
                <text>当前业务员</text>
            </div>
        </div>


        <div class="sbox">
            <div class="relation">
                <text class="state">
                                    <span style="color: <? if(count_days(date("Y-m-d"),$detail['checkpoint']) < 15 ) { echo "red";}?>">
                                    <?echo count_days(date("Y-m-d"),$detail['checkpoint'])?> 日
                                    </span>
                </text>
                <text>下次联系 <?echo substr($detail['checkpoint'],0,10)?></text>
            </div>
        </div>



    </div>









    <form id="edit-member-form" method="post"
          action="detail-edit-function.php?nav-itemed=member&nowpageid=<?echo $_GET["nowpageid"]?>"
          enctype="multipart/form-data" class="layui-form">

    <div class="layui-tab layui-tab-brief" lay-filter="docDemoTabBrief">
        <ul class="layui-tab-title">
            <li class="layui-this">详细资料</li>
            <li>项目记录 <?if(count($case)){echo "(".count($case).")";}?></li>
            <li>报价记录(X)</li>
            <li>沟通记录</li>
            <li>跟踪设置</li>
        </ul>
        <div class="layui-tab-content"  >
            <div class="layui-tab-item layui-show">
                <?php include "modules/detail-edit-info.php"; ?>
            </div>
            <div class="layui-tab-item">
                <?php include "modules/mod-case-list.php"; ?>
            </div>
            <div class="layui-tab-item">
                内容3
            </div>
            <div class="layui-tab-item contact">
                <?php include "modules/mod-contact-log.php"; ?>
            </div>
            <div class="layui-tab-item">
                <?php include "modules/mod-setting.php"; ?>

            </div>
        </div>
    </div>




        <div class="function">

        <div class="layui-input-block">
                <button class="layui-btn" lay-submit lay-filter="formMemberAdd" type="submit">立即提交</button>
                <button type="reset" class="layui-btn layui-btn-primary">重置</button>
            </div>
        </div>




    </form>


</div>
</div>

<!--content端點01-->
</div>
<!--maincontent端點01-->
<br class="clearfloat"/>
</div>
<!--container端點01-->
</div>


<?php include ROOT_PATH_ . "/controller/common/module/footer.php"; ?> </body>


<script>


    var editor;
    KindEditor.ready(function (K) {
        editor = K.create('textarea[name="member_log_content"]', {
            width : '100%',
            height : '400px',
            items : [
                'source', '|', 'undo', 'redo', '|', 'cut', 'copy', 'paste',
                'plainpaste', 'wordpaste', '|', 'justifyleft', 'justifycenter', 'justifyright',
                'justifyfull', 'insertorderedlist', 'insertunorderedlist', 'indent', 'outdent', 'subscript',
                'superscript', 'clearhtml', 'fullscreen',
                'formatblock', 'fontname', 'fontsize', '|', 'forecolor', 'hilitecolor', 'bold',
                'italic', 'underline', 'strikethrough', 'lineheight', 'removeformat','media','image', 'multiimage'
            ],
            allowFileManager: true,
            afterBlur: function () { editor.sync(); },
            allowFileManager: true,
            filterMode : false
        });

    });


    //激活发送邮件的层
    function call_send_mail(email,nid,agentnid)
    {
        var email = '<?echo $data['member']['email'];?>';
        var nid = '<? echo $data['member']['nid']; ?>';
        var agentnid = '<? echo $data['member']['agentnid']; ?>';
        var unitid = '<? echo $data['member']['unitnid']; ?>';
        layer.open({
            title:"邮件发送",
            type: 2,
            area: ['900px', '650px'],
            fixed: false, //不固定
            maxmin: true,
            content: 'modules/mod-sendmail.php?email='+email+'&menberId='+nid+'&agentnId='+agentnid+'&unitnId='+unitid
        });
    }




    //生成简易的富文本编辑框
    layui.use('layedit', function(){
        var layedit = layui.layedit;
        var layeditTool = {tool: [
                'strong' //加粗
                ,'italic' //斜体
                ,'underline' //下划线
                ,'del' //删除线
                ,'|' //分割线
                ,'left' //左对齐
                ,'center' //居中对齐
                ,'right' //右对齐
                ,'|' //分割线
                ,'link' //超链接
                ,'unlink' //清除链接
                ,'face' //表情
            ]};

        //       layedit.build('member_log_content'); //建立编辑器
    });




</script>





<script>
    layui.use('upload', function(){
        var $ = layui.jquery
            ,upload = layui.upload;

        //普通图片上传
        var uploadInst = upload.render({
            elem: '#test1'
            ,url: 'https://httpbin.org/post' //改成您自己的上传接口
            ,accept: 'file' //普通文件
            ,exts: 'jpg|jpeg|png|gif' //只允许上传压缩文件
            ,size: 60 //限制文件大小，单位 KB
            ,before: function(obj){
                //预读本地文件示例，不支持ie8
                obj.preview(function(index, file, result){
                    $('#demo1').attr('src', result); //图片链接（base64）
                });
            }
            ,done: function(res){
                //如果上传失败
                if(res.code > 0){
                    return layer.msg('上传失败');
                }
                //上传成功
            }
            ,error: function(){
                //演示失败状态，并实现重传
                var demoText = $('#demoText');
                demoText.html('<span style="color: #FF5722;">上传失败</span> <a class="layui-btn layui-btn-xs demo-reload">重试</a>');
                demoText.find('.demo-reload').on('click', function(){
                    uploadInst.upload();
                });
            }
        });




    });
</script>


</html>
